package com.ce.pms.charge.model;

import com.ce.pms.common.model.SysInfo;
import com.sitechasia.webx.core.model.IDomainObject;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinTable;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.annotations.Cascade;

@Entity
@Table(name="FEE_RECEIPT")
public class ReceiptDomain
  implements IDomainObject
{
  private static final long serialVersionUID = 1L;

  @Id
  @GeneratedValue
  @Column(name="RECEIPT_ID")
  private Long keyword;

  @Column(name="RECEIPT_NUMBER", length=50)
  private String receiptName;

  @Temporal(TemporalType.DATE)
  @Column(name="RECEIPT_DATE")
  private Date receiptDate;

  @Column(name="REMARK", length=300)
  private String remark;

  @OneToMany
  @Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE})
  @JoinTable(name="FEE_RECEIPT_R_VOUCHER", joinColumns={@javax.persistence.JoinColumn(name="RECEIPT_ID")}, inverseJoinColumns={@javax.persistence.JoinColumn(name="VOUCHER_ID")})
  private Set<VoucherDomain> vouchers = new HashSet();

  @Embedded
  private SysInfo sysInfo;

  public ReceiptDomain(Long keyword)
  {
    this.keyword = keyword;
  }

  public Long getKeyword() {
    return this.keyword;
  }

  public void setKeyword(Long keyword) {
    this.keyword = keyword;
  }

  public String getReceiptName() {
    return this.receiptName;
  }

  public void setReceiptName(String receiptName) {
    this.receiptName = receiptName;
  }

  public String getRemark() {
    return this.remark;
  }

  public void setRemark(String remark) {
    this.remark = remark;
  }

  public SysInfo getSysInfo() {
    return this.sysInfo;
  }

  public void setSysInfo(SysInfo sysInfo) {
    this.sysInfo = sysInfo;
  }

  public Set<VoucherDomain> getVouchers() {
    return this.vouchers;
  }

  public void setVouchers(Set<VoucherDomain> vouchers) {
    this.vouchers = vouchers;
  }

  public Date getReceiptDate() {
    return this.receiptDate;
  }

  public void setReceiptDate(Date receiptDate) {
    this.receiptDate = receiptDate;
  }
}